LIBNAME=myserv

INCPATH=../inc/
LIBSPATH=`pwd`/../../client/libs/
SQINCPATH=${LIBSPATH}/install/include
SQLIBPATH=${LIBSPATH}/install/lib

CFLAGS+=-I${SQINCPATH}
CFLAGS+=-I${INCPATH}
LDFLAGS+=-L${SQLIBPATH}
LDFLAGS+=-lsqlite3

CC=gcc
AR=ar

all: dynamic_lib static_lib
	@make clear
	@make install

dynamic_lib:
	${CC} -shared -fPIC *.c ${CFLAGS} ${LDFLAGS} -o lib${LIBNAME}.so

static_lib:
	${CC} -c ${CFLAGS} ${LDFLAGS} *.c
	${AR} -rcs lib${LIBNAME}.a *.o

install:
	mv lib${LIBNAME}.* ${LIBSPATH}

clear:
	rm -f *.o

clean: clear
	rm -f lib${LIBNAME}.*
